#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int arr[] = { 1,2,3,4,5,6,7,8,9,0 };
	int left = 0;
	int right = sizeof(arr) / sizeof(arr[0]) - 1;
	int num = 0;
	scanf("%d", &num);
	int mid = 0;
	while (left <= right)
	{
		mid = (left + right) / 2;
		if (arr[mid] > num)
			right = mid - 1;
		if (arr[mid] < num)
			left = mid + 1;
		if (arr[mid] == num)
			break;
	}
	printf("%d", mid);

	return 0;
}